package com.edu.jvm.unit01.heap;

import java.util.concurrent.TimeUnit;

/**
 * 启动参数：
 * -Xmx60m -Xms60m -XX:+DoEscapeAnalysis -XX:+PrintEscapeAnalysis -verbose:gc -XX:+PrintGCDetails
 *
 * @author five-five
 * @date 2021/9/17-9:22
 */
public class StackAllocation {
    public static void main(String[] args) {
        long start = System.currentTimeMillis();
        for (int i = 0; i < 1000; i++) {
            createbytes();
        }
        long end = System.currentTimeMillis();
        //计算执行时间
        System.out.println("花费的时间：" + (end - start) + "ms");
        try {
            TimeUnit.SECONDS.sleep(Integer.MAX_VALUE);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    public static void createbytes() {
        byte[] bytes = new byte[1024];
    }
}
